package com.cap7.bean;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

@Component
public class Train implements InitializingBean, DisposableBean {
    public Train() {
        System.out.println("Train ----constructor----");
    }
    //属性赋值和初始化
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("Train ----afterPropertiesSet----");
    }

    //销毁时调用
    @Override
    public void destroy() throws Exception {
        System.out.println("Train ----destory----");
    }
}
